import requests
import re

headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36',
}

res=requests.get('https://product.cheshi.com/rank/2-0-0-0-1/',headers=headers)

# .*? 匹配任意内容
# re.S 匹配转换符空格
# 匹配标题
com = re.compile('class="m_detail".*?href.*?>(.*?)<',re.S)
print(com.findall(res.text))
for title in com.findall(res.text):
    print(title)